home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-01-19 | 1.6 KB | 55 lines | [TEXT/ToyS] |
- property ddFonts : [null, null, null, {name:"Geneva", size:10}]
-
- dd install with fonts ddFonts with grayscale
- open (choose file with prompt "Choose a resource file:")
- dd uninstall
-
- on open theFiles
- set r1 to null
- set d to null
- dd install with fonts ddFonts with grayscale
- try
- set rFile to (theFiles as list)'s item 1
- set rTypes to []
- set r1 to res open rFile -- with write permission
- set rCount to res count types r1
- repeat with i from 1 to rCount
- set rTypes to rTypes & (res get type r1 index i)
- end repeat
-
- set d to dd make dialog {size:[280, 238], style:standard window, closeable:true, contents:[¬
- {class:pop up, name:"Resource Type", bounds:[10, 5, 250, 25], contents:rTypes, font:1}, ¬
- {class:list box, bounds:[-1, 55, 281, 239], column widths:[50, 170, 60], contents:ListType(r1, rTypes's item 1)}, ¬
- {class:static text, contents:"ID Name Attributes", bounds:[4, 34, 280, 50]} ¬
- ], name:"Resources in “" & (info for rFile)'s name & "”"}
- repeat
- set i to dd interact with user
- if i = 1 then
- dd set contents of item 2 of d to ListType(r1, rTypes's item (dd get value of item 1 of d))
- else if i = -1 then
- exit repeat
- end if
- end repeat
- on error
- end try
- if d ≠ null then dd delete d
- if r1 ≠ null then res close r1
- end open
-
- on quit
- dd uninstall
- continue quit
- end quit
-
- on ListType(rf, rType)
- set rInfos to []
- try
- set rCount to res count rf type rType
- repeat with i from 1 to rCount
- set inf to res get info rf type rType index i
- set rInfos to rInfos & (((inf's res id) as text) & tab & inf's res name & tab & inf's res attributes)
- end repeat
- on error
- end try
- return rInfos
- end ListType